<?php
//////////////////////////
/// Map output script ////
//////////////////////////

require_once('lib_load.php');
load_lib(array('DbMysql', 'User', 'Player'));

$player = new Player();

//$player->Refresh(); //security check

if (isset($_POST['dir'], $_POST['pas']))
{
    
    $player->Move($_POST['dir'], $_POST['pas']);
    $player->CreateOutput();
    $player->PutPlayer();
    $player->PutOthers();
    $player->Save();
    echo $player->GetOutput();
}
if (isset($_POST['x'], $_POST['y']))
    {
    $player->CreateOutput();
        $player->PutPlayer();
    $player->PutWeight($_POST['x'], $_POST['y']);
    $player->PutWay($player->GetPlayerScreenX(), $player->GetPlayerScreenY(), $player->GetPlayerWeight()-1);

    $player->PutOthers();
    echo $player->GetOutput();
    }

?>
